package cms.controller;


import cms.entity.User;
import cms.service.loginService;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.ecs.model.v20140526.DescribeInstancesRequest;
import com.aliyuncs.ecs.model.v20140526.DescribeInstancesResponse;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.exceptions.ServerException;
import com.aliyuncs.profile.DefaultProfile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping(value = "/login")
public class login {

    @Autowired
    private loginService loginService;

    @RequestMapping(value = "/login")
    @ResponseBody
    public boolean login(User user) {


        System.out.println("Access------------");
        System.out.println(user.getUsername() + "---------");

        if (loginService.login(user)) {
//            return "success";
            return true;
        } else {
//            return "fail";
            return false;
        }
    }



}

